function showhelp() {
	var url = window.location.pathname;
	url = "helpdocView.do?helpBean.ssurl=" + url;
	// alert(url);
	var name = "帮助信息";
	var iWidth = screen.width * .8;
	// var iHeight=screen.height-30;
	var iHeight = 600;
	openwindow(url, name, iWidth, iHeight);
}
function showhelp2() {
	var url = parent.mainFrame.location.pathname;
	// parent.mainFrame.document.body.style.cursor='help';
	url = "helpdocView.do?helpBean.ssurl=" + url;
	// alert(url);
	var name = "帮助信息";
	var iWidth = screen.width * .8;
	// var iHeight=screen.height-30;
	var iHeight = 600;
	openwindow(url, name, iWidth, iHeight);
}
function openwindow(url, name, iWidth, iHeight) // 居中弹出窗口
{

	var url; // 转向网页的地址;
	var name; // 网页名称，可为空;
	var iWidth; // 弹出窗口的宽度;
	var iHeight; // 弹出窗口的高度;
	var iTop = (window.screen.availHeight - 30 - iHeight) / 2; // 获得窗口的垂直位置;
	var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; // 获得窗口的水平位置;
	window
			.open(
					url,
					name,
					'height='
							+ iHeight
							+ ',width='
							+ iWidth
							+ ',top='
							+ iTop
							+ ',left='
							+ iLeft
							+ ',toolbar=no,menubar=no,scrollbars=yes,resizeable=no,location=no,status=no');
}
function sterrow(id, sttx) {
	// var url=window.location.pathname;
	var url = "sterrow.do?stxxbBean.id=" + id + "&stxxbBean.sttx=" + sttx;
	// alert(url);
	var name = "试题报错";
	var iWidth = screen.width * .8;
	// var iHeight=screen.height-30;
	var iHeight = 600;
	openwindow(url, name, iWidth, iHeight);
}
// 分别是奇数行默认颜色,偶数行颜色,鼠标放上时奇偶行颜色
var aBgColor = ["#FFFFFF", "#FFFFCC", "#f2faff", "#f2faff"];
// 从前面iHead行开始变色，直到倒数iEnd行结束
function addTableListener(o, iHead, iEnd) {
	iHead = 0;
	iEnd = 0;
	var os = document.getElementsByTagName("table");
	for (i = 0; i < os.length; i++) {
		var o = os[i];
		if (o.className == 'listTable' ||o.className == 'formTable') {
			o.style.cursor = "normal";
			iHead = iHead > o.rows.length ? 0 : iHead;
			iEnd = iEnd > o.rows.length ? 0 : iEnd;
			for (var i = iHead; i < o.rows.length - iEnd; i++) {
				setTrBgColor(o.rows[i], (o.rows[i].rowIndex % 2 != 0));
				o.rows[i].onmouseover = function() {
					setTrBgColor(this, true)
				}
				o.rows[i].onmouseout = function() {
					setTrBgColor(this, false)
				}
			}
		}
	}
}
function setTrBgColor(oTr, b) {
	oTr.rowIndex % 2 != 0 ? oTr.style.backgroundColor = b
			? aBgColor[3]
			: aBgColor[1] : oTr.style.backgroundColor = b
			? aBgColor[2]
			: aBgColor[0];
}
function onloadEvent(func) {
	var one = window.onload
	if (typeof window.onload != 'function') {
		window.onload = func
	} else {
		window.onload = function() {
			one();
			func();
		}
	}
}
onloadEvent(addTableListener);
